Ubuntu 14.04
Sponsored Link

Use mod_proxy_wstunnel
2016/02/20
 
Enable mod_proxy_wstunnel module to set WebSocket Proxy.
[1] For example, configure httpd to set proxy on /chat for an application which listens on localhost:1337. The sample application is from here (section [3]).
root@www:~#
a2enmod proxy proxy_http proxy_wstunnel

root@www:~#
vi /etc/apache2/mods-enabled/proxy.conf
# add into <IfModule mod_proxy **> - </IfModule>

<IfModule mod_proxy.c>
    ProxyRequests Off
    <Proxy *>
        Require all granted
    </Proxy>

    ProxyPass /socket.io/ http://127.0.0.1:1337/socket.io/
    ProxyPassReverse /socket.io/ http://127.0.0.1:1337/socket.io/

    ProxyPass /chat http://127.0.0.1:1337/
    ProxyPassReverse /chat http://127.0.0.1:1337/

root@www:~#
/etc/init.d/apache2 restart

* Restarting web server apache2
...done.
  Access to the sample App to make sure it works normally on proxy environment.
 
Tweet